package com.nw.controller;

import com.nw.entity.Like;
import com.nw.service.LikeService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;

@RestController
@RequestMapping("like")
public class LikeController {
    @Resource
    LikeService likeService;
    /**
     * 添加收藏
     * */
    @RequestMapping("addLike")
    public HashMap<String, Object> insertLike(Like like) {
        HashMap<String, Object> map = likeService.insertLike(like);
        return map;
    }
    /**
     * 查询收藏
     * */
    @RequestMapping("getLike")
    public HashMap<String, Object> getLike(String likeUserId) {
        HashMap<String, Object> map = likeService.getLike(likeUserId);
        return map;
    }
    /**
     *移除收藏
     */
    @RequestMapping("update")
    public HashMap<String, Object> updateLikeStatus(Like like) {
        HashMap<String, Object> map = likeService.updateLikeStatus(like);
        return map;
    }
}
